//
//  QualityInspection.m
//  YaoHeAPP
//
//  Created by mac on 16/1/26.
//  Copyright © 2016年 mac. All rights reserved.

//******************************************申请质检的数据

#import "QualityInspection.h"

@implementation QualityInspection
-(id)initWithDid:(NSDictionary*)dic
{
    self=[super init];
    if (self) {
        self.priceUnit=[[self withDic:dic Key:@"PRICE_UNIT"] integerValue];
        self.materialName=[self withDic:dic Key:@"MATERIAL_NAME"];
        self.categoryName=[self withDic:dic Key:@"CATEGORY_NAME"];
        self.status=[[self withDic:dic Key:@"STATUS"] integerValue];
        self.varietyName=[self withDic:dic Key:@"VARIETY_NAME"];
        self.tolerance=[self withDic:dic Key:@"TOLERANCE"];
        self.surfaceName=[self withDic:dic Key:@"SURFACE_NAME"];
        self.specCode=[self withDic:dic Key:@"SPEC_CODE"];
        self.quotePrice=[self withDic:dic Key:@"QUOTE_PRICE"];
        self.orderID=[self withDic:dic Key:@"ORDER_ID"];
        self.weight=[self withDic:dic Key:@"WEIGHT"];
        self.supplyProvinceID=[self withDic:dic Key:@"SUPPLY_PROVINCE_ID"];
        self.quantity=[self withDic:dic Key:@"QUANTITY"];
        self.isNeedTesting=[self withDic:dic Key:@"IS_NEED_TESTING"];
        self.supplyCityID=[self withDic:dic Key:@"SUPPLY_CITY_ID"];
        self.orderTime=[self withDic:dic Key:@"ORDER_TIME"];
        self.tradeMark=[self withDic:dic Key:@"TRADE_MARK"];
        self.volume=[self withDic:dic Key:@"VOLUME"];
        self.nationalStandard=[self withDic:dic Key:@"NATIONAL_STANDARD"];
    }
    return self;
}
-(NSString*)withDic:(NSDictionary*)dic Key:(NSString*)key
{
    NSString*string;
    if ([[dic allKeys]containsObject:key]) {
        string=dic[key];
    }
    else{
        string=@"";
    }
    return string;
}
@end

@implementation ZhiJianIsNeed

-(id)initWithDid:(NSDictionary*)dic
{
    self=[super init];
    if (self) {
        self.orderInfosAry=dic[@"ORDER_INFOS"];
        self.companyName=[self withDic:dic Key:@"COMPANY_NAME"];
    }
    return self;
}
-(NSString*)withDic:(NSDictionary*)dic Key:(NSString*)key
{
    NSString*string;
    if ([[dic allKeys]containsObject:key]) {
        string=dic[key];
    }
    else{
        string=@"*******************************************************************************************************";
    }
    return string;
}

@end

















